package br.com.pentagrama.service.dto;

import java.util.ArrayList;
import java.util.List;

public class ResultadoPorta {

	private String host;
	
	private List<Porta> portas = new ArrayList<Porta>();
	
	
	public ResultadoPorta(String host) {
		this.host = host;
	}
	
	public void addPorta(Integer porta, boolean aberta) {
		portas.add(new Porta(porta, aberta));
	}

	public String getHost() {
		return host;
	}

	public void setHost(String host) {
		this.host = host;
	}

	public List<Porta> getPortas() {
		return portas;
	}

	public void setPortas(List<Porta> portas) {
		this.portas = portas;
	}

	@Override
	public String toString() {
		StringBuilder builder = new StringBuilder();
		for(Porta p : portas) {
			builder.append(p.getPorta() + "-" + p.isSituacao());
			builder.append("\n");
		}
		return builder.toString();
	}
	
	
	
}
